@extends('admin.index')
@section('title','用户添加')
 @section('con')
 <div class="row">
 	@if (count($errors) > 0)
	    <div class="alert alert-danger">
	        <ul>
	            @foreach ($errors->all() as $error)
	                <li>{{ $error }}</li>
	            @endforeach
	        </ul>
	    </div>
	@endif
    <div class="col-lg-6 col-lg-offset-3">
        <form role="form" method="post" action="{{url('/admin/user/update')}}" enctype="multipart/form-data">
            <div class="form-group">
                <label>账号</label> <span></span>
                <input class="form-control" readmin="请输入6-18位账号" type="text" name="username" readonly value="{{$res[0]->username}}">
                <p class="help-block"></p>
            </div>
            <div class="form-group">
                <label>密码</label> <span></span>
                <input class="form-control" readmin="请输入6-18位密码" type="password" name="password" value="{{$res[0]->password}}">
                <p class="help-block"></p>
            </div>
            <input type="hidden" name="id" value="{{$res[0]->id}}">
            @if($users->auth == 5)
            <div class="form-group">
                <label>权限</label>
                <select class="form-control" name='auth' value="">
                    <option value='1' {{$res[0]->auth==1?'selected':''}} >普通用户</option>
                    <option value='2' {{$res[0]->auth==2?'selected':''}} >vip用户</option>
                    <option value='3' {{$res[0]->auth==3?'selected':''}} >广告用户</option>
                    <option value='4' {{$res[0]->auth==4?'selected':''}} >管理员</option>
                    <option value='5' {{$res[0]->auth==5?'selected':''}} >超级管理员</option>
                </select>
                <p class="help-block"></p>
            </div>
            @elseif($users->auth == 4)
            <div class="form-group">
                <label>权限</label>
                <select class="form-control" name='auth' value="">
                    <option value='1' <?php echo $res[0]->auth==1?'selected':''; ?> >普通用户</option>
                    <option value='3' <?php echo $res[0]->auth==3?'selected':''; ?> >广告用户</option>
                </select>
                <p class="help-block"></p>
            </div>
            @endif
            {{ csrf_field() }}
            <button class="btn btn-default" type="submit">提交</button>
            <button class="btn btn-default" type="reset">重置</button>
        </form>
    </div>
 </div>  
 @endsection
